Ext.define("AmpleHarvest.objects.search.results.grid.FileResultsGrid", {
   extend: 'Ext.grid.Panel',
   alias: 'widget.ampleharvest-objects-search-results-grid-fileresultsgrid',
   
   requires: ['AmpleHarvest.DATA.Store.FileSearchStore'],

   layout: 'fit',
   width: '100%',
   requires : [ ],
   columns        :
         [
               //{  header      : 'ID',      dataIndex   : 'id'},
               {  header      : 'Name', dataIndex   : 'name', width: 200,
                  renderer: function(value, metaData, record) { return "<b>"+value+"</b>" } },
               {  header      : 'Extension',    dataIndex   : 'extension'},
               {  header      : 'Size',    dataIndex   : 'size',
                  renderer: function(value, metaData, record) { return value } },
               {  header      : 'MD5',    dataIndex   : 'md5Hash', width: 50},
               {  header      : 'SHA1',    dataIndex   : 'sha1Hash'},
               {  header      : 'Mime Type',    dataIndex   : 'mimeType',
                  renderer: function(value, metaData, record) { return value } },
               {  header      : 'Applications',    dataIndex   : 'applications'}
         ],
         
   
   
   constructor: function(config) {

      this.store = Ext.create('AmpleHarvest.DATA.Store.FileSearchStore');
      
      this.dockedItems= [{
        xtype: 'pagingtoolbar',
        store: this.store,
        dock: 'bottom',
        displayInfo: true
    }],
        this.callParent(arguments);
    },
    
   initComponent : function()
   {
      
      this.addListener({
           'itemdblclick' : this.itemdblclick
      });
      
      this.callParent();
   },
    
   itemdblclick : function(viewThis, record)
   {
      //m_obj_AmpleHarvest_ViewPort.fireEvent( AmpleHarvest.eventHandler.cWindowEvents.C_STR_EVENT_APPLICATION_OPEN, record );
   },
   
   loadURL  : function(url)
   {
      this.store.loadSearchParam(Ext.decode(url.Json_Query).Query[0].value);
      this.store.load();
   }
});